package com.hue.springcloud.service;

import com.hue.springcloud.service.impl.OrderSerivceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;

@Component
//当该接口的方法发生错误时，调用fallback中的方法来完成服务降级
@FeignClient(value="CLOUD-PROVIDER-HYSTRIX-PAYMENT",fallback = OrderSerivceImpl.class)
public interface OrderService {
    @GetMapping("/payment/hystrix/ok")
    public String ok();

    @GetMapping("/payment/hystrix/timeout")
    public String timeout() throws InterruptedException;
}
